home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20021006-20030409
/
000376_fdc@columbia.edu_Thu Mar 13 15:22:57 EST 2003.msg
< prev
next >
Wrap
Text File
|
2003-04-08
|
3KB
|
63 lines
Article: 14174 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
From: fdc@columbia.edu (Frank da Cruz)
Newsgroups: comp.os.linux.networking,comp.protocols.kermit.misc
Subject: Re: General FTP Questions
Date: 13 Mar 2003 15:00:50 -0500
Organization: Columbia University
Lines: 46
Message-ID: <b4qo1i$6pe$1@watsol.cc.columbia.edu>
References: <3e70e070@snipnews.snip.net>
NNTP-Posting-Host: watsol.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1047585659 27522 128.59.39.139 (13 Mar 2003 20:00:59 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 13 Mar 2003 20:00:59 GMT
Xref: newsmaster.cc.columbia.edu comp.os.linux.networking:416180 comp.protocols.kermit.misc:14174
In article <3e70e070@snipnews.snip.net>,
Jason Efting <jefting@vouzi.co.uk> wrote:
: Question 1:
: ------------
: I have a problem where text files uploaded to my FTP server are only
: transmitted partially. In other words if I open the text file I might only
: have half of the actual text inside the file. Is there any way that I can
: prevent this from happening so that I only receive complete files?
:
: Question 2:
: ------------
: Once a file has been uploaded it to my box a have script takes the file and
: processes it. (The data from the text file is imported into a database and
: the text file is archived.) If I receive a big file the file might still be
: transferring when my script processes the file, this causes some problems.
: (My script will only import the file partially and then archive it.) How can
: I check if the file is complete before I process the file? I through about
: using a cron job to move uploaded files to another directory and then
: process them but I need to process the file immediately once it is uploaded.
:
: FTP Server: vsFTPd orWU-FTPD
: OS: Redhat Linux 8
:
Both of these questions are answered here:
http://www.columbia.edu/kermit/ftpscripts.html
In both cases, you want to transfer the file to a temporary directory and
then, at the moment the transfer is complete, and only if it was successful,
move it or rename it to a "ready" directory. This prevents partial or
in-progress files from being treated as if they were complete. It also
ensures that each file is processed exactly once -- not thrice, not twice,
and not zero times.
Clearly you can't force file transfers to always work. Connections break
sometimes for reasons you can't control. The best you can do is ensure
that incomplete transfers are sequestered (by the server) where they won't do
any harm and detected and handled (by the client) so it can take corrective
action. All this is explained in the above reference.
Also see:
http://www.columbia.edu/kermit/ftpclient.html
http://www.columbia.edu/kermit/ckscripts.html#ftp
- Frank